package com;

import com.entity.Student;
import com.genercis.SupperArray;

import java.util.ArrayList;
import java.util.List;

/**
 * Test
 *
 * @author byc
 * @date 2022-02-05
 */
public class Test {

    public static void main(String[] args) {
        SupperArray<Student> supperArray = new SupperArray<>();
        supperArray.addToHead(new Student("卢本伟",38));
        supperArray.addToHead(new Student("PDD",38));
        supperArray.addToHead(new Student("山泥若",38));

        for (int i = 0; i < supperArray.size(); i++) {
            if (supperArray.select(i) instanceof Student) {
                Student student = supperArray.select(i);
//                student.play();
            }
        }

        Student a = (Student) supperArray.select(4);
        if (null != a){
//            a.play();
        }

        System.out.println("-------------------");

        List<Integer> test1 = new ArrayList<>();
        test1.add(1);
        test1.add(2);
        test1.add(3);
        test1.add(4);
        test1.add(5);
        test1.add(6);

        List<Integer> test2 = new ArrayList<>();

        test2.addAll(test1);
        test2.remove(3);

        for (Integer integer : test1) {
            System.out.print(integer);
        }

        System.out.println();
        test2.forEach(System.out::print);


    }
}
